package cn.iocoder.yudao.module.promotion.gift.service.core;

import cn.iocoder.yudao.framework.business.basic.service.CrudService;
import cn.iocoder.yudao.framework.business.basic.service.impl.BaseService;
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
import cn.iocoder.yudao.module.promotion.gift.convert.GiftScanConfigConvert;
import cn.iocoder.yudao.module.promotion.gift.dao.GiftScanConfigMapper;
import cn.iocoder.yudao.module.promotion.gift.pojo.dto.GiftScanConfigQueryDTO;
import cn.iocoder.yudao.module.promotion.gift.pojo.dto.GiftScanConfigSaveDTO;
import cn.iocoder.yudao.module.promotion.gift.pojo.po.GiftScanConfig;
import cn.iocoder.yudao.module.promotion.gift.pojo.vo.GiftScanConfigVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 服务
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/05/27
 */
@Service
public class CoreGiftScanConfigService extends BaseService<GiftScanConfig, GiftScanConfigVO, GiftScanConfigQueryDTO> implements CrudService<GiftScanConfig, GiftScanConfigVO, GiftScanConfigSaveDTO, GiftScanConfigQueryDTO> {
    @Resource
    private GiftScanConfigMapper giftScanConfigMapper;

    @Override
    public GiftScanConfigMapper getInjectedMapper() {
        return giftScanConfigMapper;
    }

    @Override
    public GiftScanConfig convertToEntity(GiftScanConfigSaveDTO param) {
        return GiftScanConfigConvert.INSTANCE.toEntity(param);
    }

    @DataPermission(enable = false)
    public List<Long> getGiftActivityIds(Long shopId, Integer price) {
        return giftScanConfigMapper.selectGiftActivityIds(shopId, price);
    }

}
